#include<string>
using namespace std;

/* class Solution {
public:
    string modifyString(string s) {
        int n = s.size();
        for(int i = 0 ; i < n ; i++){
            if(s[i] == '?'){
                for(int j = 'a' ; j <= 'z' ; j++){
                    if(i == 0){
                        if(j != s[i+1]){ 
                            s[i] = j;
                            break;
                        }
                    }else if(i == n-1){
                        if(j != s[i-1]) {
                            s[i] = j;
                            break;
                        }
                    }else{
                        if(j != s[i+1] && j != s[i-1])  {
                            s[i] = j;
                            break;}
                    }
                }
            }
        }
        return s;
    }
}; */
class Solution {
public:
    string modifyString(string s) {
        int n = s.size();
        for(int i = 0 ; i < n ; i++){
            if(s[i] == '?'){
                for(char j = 'a' ; j <= 'z' ;j++){
                    if((i == 0 || s[i-1] != j)  && (i == n-1 || s[i+1] != j) ){
                        s[i] = j;}
                    }
                }
        }
        return s;
    }
};